package com.vfmall.mapper;

import com.github.pagehelper.Page;
import com.vfmall.annotation.AutoFill;
import com.vfmall.dto.DishPageQueryDTO;
import com.vfmall.dto.EmployeePageQueryDTO;
import com.vfmall.entity.Dish;
import com.vfmall.enumeration.OperationType;
import com.vfmall.vo.DishVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    @AutoFill(value= OperationType.INSERT)
    void insert(Dish dish);
    @Select("select count(*) from dish where category_id=#{CategoryId}")
    Integer countByCategoryId(Long CategoryId);
    Page<DishVO> pageQuery(DishPageQueryDTO dishPageQueryDTO);
    @Select("select * from dish where id=#{id}")
    Dish getById(Long id);
    @Delete("delete from dish where id=#{id}")
    void deleteById(Long id);
    DishVO getByIdWithFlavor(Long id);
    /*
    * @Description: 根据id修改菜品
    * @Param: [dish]
     */
    @AutoFill(value= OperationType.UPDATE)
    void update(Dish dish);
    List<Dish> list(Dish dish);
}
